<?php

namespace App\Http\Requests\Api\v2;

use App\Http\Requests\CommonRequest;

class CommentRequest extends CommonRequest
{
      public $scenes = [
            'reply' => 'id,reply'
        ];

    public function rules()
    {
        return [
            'shop_id' => ['required'],
            'content' => ['required'],
            'order_id' => ['required', 'integer'],
            'total_score' => ['required', 'integer', 'min:0', 'max:5'],
            'taste_score' => ['required', 'integer', 'min:0', 'max:5'],
            'pack_score' => ['required', 'integer', 'min:0', 'max:5'],
        ];
    }

    public function replyRules(){
        return [
            'id' => ['required', 'integer'],
            'reply' => ['required']
        ];
    }

    public function messages()
    {
        return [
            'reply.required' => "回复内容不能为空",


            'id.required' => "id不能为空",
            'id.integer' => "id为数字",

            'shop_id.required' => "店铺不能为空",
            'content.required' => "评价内容不能为空",
            'order_id.required' => "订单id不能为空",
            'order_id.integer' => "订单id为数字",

            'total_score.required' => "总评分不能为空",
            'total_score.integer' => "总评分请填写数字",
            'total_score.min' => "总评分不能小于0",
            'total_score.max' => "总评分不能大于5",

            'taste_score.required' => "味道分不能为空",
            'taste_score.integer' => "味道分请填写数字",
            'taste_score.min' => "味道分不能小于0",
            'taste_score.max' => "包装分不能大于5",

            'pack_score.required' => "包装分不能为空",
            'pack_score.integer' => "包装分请填写数字",
            'pack_score.min' => "包装分不能小于0",
            'pack_score.max' => "包装分不能大于5",

        ];
    }
}
